<template>
  <div>
    <el-table
        :data="tableData.results"
        border
        style="width: 100%"
    >
      <el-table-column
          type="index"
          width="50" label="序号" align="center"
      >
      </el-table-column>
      <el-table-column prop="status" label="审批状态" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.status == 0">需求单位填报</span>
          <span v-if="scope.row.status == 1">保障部（初审）</span>
          <span v-if="scope.row.status == 2">运维技术部（审核）</span>
          <span v-if="scope.row.status == 3">运维总集（联通）上传完成情况</span>
          <span v-if="scope.row.status == 4">需求单位确认</span>
          <span v-if="scope.row.status == 5">结束</span>
        </template>
      </el-table-column>
      <el-table-column
          prop="login_name"
          label="审批机构" align="center"
      >
      </el-table-column>
      <el-table-column
          prop="message"
          label="审批意见" align="center"
      >
      </el-table-column>
      <el-table-column
          prop="create_date"
          label="审批时间" align="center"
      >
        <template slot-scope="{row}">
          {{ $util.formatDate(row.create_date, 'yyyy-MM-dd hh:mm:ss') }}
        </template>
      </el-table-column>
    </el-table>
    <div class="page">
      <el-pagination @size-change="pageSizeChange" @current-change="pageNoChange" :page-sizes="[10, 50, 100, 200]"
                     :page-size="10" background layout="total, sizes, prev, pager, next" :total="tableData.totalRecord"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  name: 'examinePage',
  data() {
    return {
      tableData: {},
      pageNo: '1',
      pageSize: '10',
      loading: false,
      data: {}
    }
  },
  mounted() {
  },
  methods: {
    getList(row) {
      console.log(row)
      this.data = row
      this.info()
    },
    async info() {
      this.loading = true
      const res = await this.$http('infoWorkOrderServicefindLogPageList', {
        pageNo: this.pageNo,
        pageSize: this.pageSize,
        work_order_id: this.data.id
      })
      this.tableData = res
      this.loading = false
    },
    pageNoChange(pageNo) {
      this.pageNo = pageNo
      this.init()
    },
    pageSizeChange(pageSize) {
      this.pageSize = pageSize
      this.init()
    }
  }
}
</script>

<style scoped>

</style>
